

using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Filter;
using CoreCms.Net.Loging;
using CoreCms.Net.IServices;
using CoreCms.Net.Utility.Helper;
using CoreCms.Net.Utility.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using NPOI.HSSF.UserModel;
using SqlSugar;

namespace CoreCms.Net.Web.Admin.Controllers
{
    /// <summary>
    /// 
    ///</summary>
    [Description("")]
    [Route("api/[controller]/[action]")]
    [ApiController]
    [RequiredErrorForAdmin]
    [Authorize]
    public class FeedbackController : ControllerBase
    {
        private readonly IWebHostEnvironment _webHostEnvironment;
        private readonly IfeedbackServices _feedbackServices;

        /// <summary>
        /// 构造函数
        ///</summary>
        public FeedbackController(IWebHostEnvironment webHostEnvironment
            ,IfeedbackServices feedbackServices
            )
        {
            _webHostEnvironment = webHostEnvironment;
            _feedbackServices = feedbackServices;
        }

        #region 反馈提交============================================================
        // POST: Api/feedback/DoCreate
        /// <summary>
        /// 反馈提交
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [HttpPost]
        [Description("反馈提交")]
        public async Task<AdminUiCallBack> SubFeedBack([FromBody]FMFeedBack entity)
        {
            var jm = new AdminUiCallBack();
            if (!string.IsNullOrEmpty(entity.desc))
            {
                jm = await _feedbackServices.SubFeedBack(entity.desc);
            }
            else
            {
                jm.code = 1;
                jm.msg = "提交内容不能为空";
            }
            return jm;
        }
        #endregion

    

        

    }
}
